package org.zhxy.common.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.zhxy.core.personnel.mapper.*;
import org.zhxy.core.principal.mapper.*;
import org.zhxy.core.quality.mapper.ClassesMapper;
import org.zhxy.core.quality.mapper.ClassesTeacherMapper;
import org.zhxy.core.quality.mapper.StudentClassesMapper;
import org.zhxy.core.quality.mapper.StudentManagerMapper;
import org.zhxy.core.system.mapper.*;

import javax.annotation.PostConstruct;

@Configuration
@SuppressWarnings("all")
public class MapperFactory {

    //系统
    @Autowired
    private PermissionMapper pm;
    public static PermissionMapper permissionMapper;
    @Autowired
    private RoleMapper rm;
    public static RoleMapper roleMapper;
    @Autowired
    private UserMapper um;
    public static UserMapper userMapper;
    @Autowired
    private UserRoleMapper urm;
    public static UserRoleMapper userRoleMapper;
    @Autowired
    private RolePermissionMapper rpm;
    public static RolePermissionMapper rolePermissionMapper;
    @Autowired
    private DictionaryMapper dicm;
    public static DictionaryMapper dictionaryMapper;
    @Autowired
    private UserMaterialMapper umm;
    public static UserMaterialMapper userMaterialMapper;


    //校长办
    @Autowired
    private SchoolMapper sm;
    public static SchoolMapper schoolMapper;
    @Autowired
    private SubSchoolMapper ssm;
    public static SubSchoolMapper subSchoolMapper;
    @Autowired
    private DepartmentMapper dm;
    public static DepartmentMapper departmentMapper;
    @Autowired
    private SchoolAssetsMapper sam;
    public static SchoolAssetsMapper schoolAssetsMapper;
    @Autowired
    private VocationalMapper vm;
    public static VocationalMapper vocationalMapper;
    @Autowired
    private StageMapper stageM;
    public static StageMapper stageMapper;



    //教质
    @Autowired
    private ClassesMapper cm;
    public static ClassesMapper classesMapper;
    @Autowired
    private ClassesTeacherMapper ctm;
    public static ClassesTeacherMapper classesTeacherMapper;
    @Autowired
    private StudentManagerMapper smm;
    public static StudentManagerMapper studentManagerMapper;
    @Autowired
    private StudentClassesMapper scm;
    public static StudentClassesMapper studentClassesMapper;


    //人事行政
    @Autowired
    private TeacherMapper tm;
    public static TeacherMapper teacherMapper;
    @Autowired
    private TeacherDepartmentMapper tdm;
    public static TeacherDepartmentMapper teacherDepartmentMapper;
    @Autowired
    private TeacherGeneralMapper tgm;
    public static TeacherGeneralMapper teacherGeneralMapper;
    @Autowired
    private TeacherResignationMapper trm;
    public static TeacherResignationMapper teacherResignationMapper;
    @Autowired
    private TeacherClassesMapper tcm;
    public static TeacherClassesMapper teacherClassesMapper;

    @PostConstruct
    public void initMapper(){
        permissionMapper = this.pm;
        roleMapper = this.rm;
        userMapper = this.um;
        userRoleMapper = this.urm;
        rolePermissionMapper = this.rpm;
        dictionaryMapper = this.dicm;
        userMaterialMapper = this.umm;

        schoolMapper = this.sm;
        subSchoolMapper = this.ssm;
        departmentMapper = this.dm;
        schoolAssetsMapper = this.sam;
        vocationalMapper = this.vm;
        stageMapper = this.stageM;

        classesMapper = this.cm;
        classesTeacherMapper = this.ctm;
        studentManagerMapper = this.smm;
        studentClassesMapper = this.scm;

        teacherMapper = this.tm;
        teacherDepartmentMapper = this.tdm;
        teacherGeneralMapper = this.tgm;
        teacherResignationMapper = this.trm;
        teacherClassesMapper = this.tcm;
    }
}
